<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"--%>
<%--"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">--%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>无标题文档</title>
    <link href="/css/style.css" rel="stylesheet" type="text/css"/>
    <link href="/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css"/>
    <link href="/layui/css/layui.css" rel="stylesheet" type="text/css"/>
    <script language="JavaScript" src="/js/jquery.js"></script>
    <script src="/js/custom/login.js" type="text/javascript"></script>
    <script src="/bootstrap/js/bootstrap.js" type="text/javascript"></script>
    <script src="/layui/layui.js" type="text/javascript"></script>
    <script type="text/javascript">

        // window.onload = function () {
        //     var userRealName = getCookie('userRealName');
        //     $("#userRealName").text(userRealName);
        // }

        // 获取指定cookie的值
        function getCookie(cname) {
            var name = cname + "=";
            var ca = document.cookie.split(';');
            for (var i = 0; i < ca.length; i++) {
                var c = ca[i].trim();
                if (c.indexOf(name) == 0) {
                    return decodeURI(c.substring(name.length, c.length));
                }
            }
            return "";
        }

        // 开启全屏，参考：https://blog.csdn.net/motou263514/article/details/91579099
        function launchIntoFullscreen(element) {
            if (element.requestFullscreen) {
                element.requestFullscreen();
            } else if (element.mozRequestFullScreen) {
                element.mozRequestFullScreen();
            } else if (element.webkitRequestFullscreen) {
                element.webkitRequestFullscreen();
            } else if (element.msRequestFullscreen) {
                element.msRequestFullscreen();
            }
        }

        // 关闭全屏
        function exitFullscreen() {
            if (document.exitFullscreen) {
                document.exitFullscreen();
            } else if (document.mozCancelFullScreen) {
                document.mozCancelFullScreen();
            } else if (document.webkitExitFullscreen) {
                document.webkitExitFullscreen();
            }
        }

        // 查看是否全屏
        function checkFull() {
            var isFull = false;
            if (document.fullscreenEnabled || document.msFullscreenEnabled) {
                isFull = window.fullScreen || document.webkitIsFullScreen;
                if (isFull === undefined) {
                    isFull = false;
                }
            }
            return isFull;
        }

        // 开启/关闭全屏按钮
        function openOrCloseFull() {
            if (checkFull()) {
                exitFullscreen();
            } else {
                launchIntoFullscreen(document);
            }
        }

        function about() {
            alert("本系统是基于SpringBoot开发的学生宿舍管理系统！");
        }

        function user_logout() {
            if(confirm("确定退出吗??")){
                parent.location.href="/UserController.do?action=logout";
            }
        }

    </script>


</head>

<body style="background:url(/images/topbg.gif) repeat-x;" id="test">

<div class="topleft">
    <a href="main" target="_parent"><img src="/images/logo.png" title="系统首页"/></a>
</div>

<!--    <ul class="nav">-->
<!--    <li><a href="default" target="rightFrame" class="selected"><img src="/images/icon01.png" title="工作台" /><h2>工作台</h2></a></li>-->
<!--    <li><a href="imgtable" target="rightFrame"><img src="/images/icon02.png" title="模型管理" /><h2>模型管理</h2></a></li>-->
<!--    <li><a href="imglist" target="rightFrame"><img src="/images/icon03.png" title="模块设计" /><h2>模块设计</h2></a></li>-->
<!--    <li><a href="tools" target="rightFrame"><img src="/images/icon04.png" title="常用工具" /><h2>常用工具</h2></a></li>-->
<!--    <li><a href="computer" target="rightFrame"><img src="/images/icon05.png" title="文件管理" /><h2>文件管理</h2></a></li>-->
<!--    <li><a href="tab" target="rightFrame"><img src="/images/icon06.png" title="系统设置" /><h2>系统设置</h2></a></li>-->
<!--    </ul>-->

<div class="topright">
    <ul>
        <!--        <li>-->
        <!--            <span>-->
        <!--                <img src="/images/help.png" title="全屏" class="helpimg"/>-->
        <!--            </span>-->
        <!--            <a href="#" onclick="openOrCloseFull()">全屏</a>-->
        <!--        </li>-->
        <li><a href="#" onclick="about()">关于</a></li>
        <li><a href="#" onclick="user_logout()">退出</a></li>
    </ul>

    <div class="user">
        <a href="viewOwnUser" target="rightFrame"><span id="userRealName">${sessionScope.loginUser.userName}</span></a>
        <!--        <i>消息</i>-->
        <!--        <b>5</b>-->
    </div>
</div>
</body>
</html>
